﻿                                           using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo02
{
    class Program
    {
        static void Main(string[] args)
        {
            Class1 a = new Class1();
            a.account = 134566;
            a.username = 112;
            a.password = 123456;
            a.add();
          

        }

        static void Test1() {
            //实心正方形
            Console.WriteLine("请输入正方形边长：");
            int a = int.Parse(Console.ReadLine());
            string[,] arr = new string[a, a];

            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < arr.GetLength(1); j++)
                {
                    arr[i, j] = "*";
                }
            }
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < arr.GetLength(1); j++)
                {
                    Console.Write(arr[i, j]);
                }
                Console.WriteLine();
            }
        }
        static void Test2() {
            int[,] arr = new int[9, 9];
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < i; j++)
                {
                    Console.Write((i + 1) + " * " + (j + 1) + " = " + (i + 1) * (j + 1) + "\t");
                }
                Console.WriteLine();
            }
        }

        static void Test3() {
            Console.WriteLine("请输入正方形边长：");
            int a = int.Parse(Console.ReadLine());
            string[,] arr = new string[a, a];

            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < arr.GetLength(1); j++)
                {
                    if (i == 0 || i == arr.GetLength(0) - 1)
                    {
                        arr[i, j] = " *";
                    }
                    else if (j == 0 || j == arr.GetLength(1) - 1)
                    {
                        arr[i, j] = " *";
                    }
                    else
                    {
                        arr[i, j] = "  ";
                    }

                }
            }
            for (int i = 0; i < a; i++)
            {
                for (int j = 0; j < a; j++)
                {
                    Console.Write(arr[i, j]);
                }
                Console.WriteLine();
            }


        }

        static void Test4()
        {
            Console.WriteLine("请输入菱形的边长");
            int a = int.Parse(Console.ReadLine());
            string[,] b = new string[a * 2, a * 2];
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    if (i <= a && j > a - i && j < a + i || a < i && j > i - a && j <= 3 * a - 1 - i)
                    {
                        b[i, j] = " *";
                    }
                    else
                    {
                        b[i, j] = "  ";
                    }
                }
            }
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    Console.Write(b[i, j]);
                }
                Console.WriteLine();
            }

        }

        static void Test5() {
            int[] a = { 10, 8, 6, 4, 2 };
            int[] c = new int[6];
            Console.WriteLine("输入一个数");
            int b = int.Parse(Console.ReadLine());
            for (int i = 0; i < a.Length; i++)
            {
                c[i] = a[i];
            }
            c[5] = b;
            Array.Sort(c);
            Array.Reverse(c);
            for (int i = 0; i < c.Length; i++)
            {
                Console.Write(c[i] + " ");
            }

        }

        static void Test6() {
            string[] a = { "ab", "cd", "ef", "gh", "ij" };
            for (int i = 0; i < a.Length; i++)
            {
                if (i % 2 == 0)
                {
                    Console.Write(a[i] + " ");
                }
            }
        }

        static void Test7() {
            Console.WriteLine("生成几行");
            int a = int.Parse(Console.ReadLine());
            int[,] b = new int[a, a];
            for (int i = 0; i < a; i++)
            {
                for (int j = 0; j <= i; j++)
                {
                    if (j == 0)
                    {
                        b[i, j] = 1;
                    }
                    else if (j == i)
                    {
                        b[i, j] = 1;
                    }
                    else if (i >= 2)
                    {
                        b[i, j] = b[i - 1, j - 1] + b[i - 1, j];
                    }
                }
            }
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    if (b[i, j] != 0)
                    {
                        Console.Write(b[i, j] + " " + "\t");
                    }
                }
                Console.WriteLine();
            }
        }
    }
}
